function timestampToTime() {
  var date = new Date(); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
  var year = date.getFullYear(); // 年
  var month = checkTime(date.getMonth() + 1); //月
  var day = checkTime(date.getDate()); //日
  var hour = checkTime(date.getHours()); //时
  var minutes = checkTime(date.getMinutes()); //分
  var seconds = checkTime(date.getSeconds()); //秒
  return (
    year + "-" + month + "-" + day + " " + hour + ":" + minutes);
}
function checkTime(i) {
  //月日时分秒不足10时,补全0
  if (i < 10) {
    i = "0" + i;
  }
  return i;
}
module.exports = timestampToTime();